package com.cssw.fyzb.web.service;

import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.base.web.domain.AjaxPage;
import com.cssw.fyzb.core.dao.live.AnchorDao;
import com.cssw.fyzb.core.model.dodb.CmfAnchor;
import com.ydn.dbframe.plugin.activerecord.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: tjf
 * @Date: 2020/10/10 15:09
 */
@Service
public class CmfAnchorService {

    @Autowired
    private AnchorDao anchorDao;

    /**
     * 查询主播列表
     *
     * @param page
     * @param limit
     * @return
     */
    public AjaxPage list(int page, int limit,String search) {
        Page<CmfAnchor> pages = anchorDao.listAnchor(page, limit,search);
        return AjaxPage.success(pages.getList(), pages.getTotalRow(), pages.getTotalPage());
    }

    public AjaxData updateStatus(Long anchorId,String status,Long sysOperId){
        return AjaxData.success(anchorDao.queryAnchorSaveSate(anchorId,status));
    }
}
